﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BlueCMS.Core.Data.Query.Common
{
    public class ConditionOperator : Condition
    {
        public ConditionOperator(BinaryOperators type)
            : base(type)
        {
        }

        public ConditionOperator(BinaryOperators type, SelectQuery query)
            : base(query, type)
        {
        }

        public ConditionLogicOperator And()
        {
            ConditionLogicOperator and = new ConditionLogicOperator(BinaryOperators.And);
            Next = and;
            return and;
        }

        public ConditionLogicOperator Or()
        {
            ConditionLogicOperator or = new ConditionLogicOperator(BinaryOperators.Or);
            Next = or;
            return or;
        }

        public ConditionEndGroup EndGroup()
        {
            ConditionEndGroup end = new ConditionEndGroup();
            Next = end;
            return end;
        }
    }
}
